home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / C Guide / Simple_Module2 / MenuWindow / menuwindow.h < prev    next >
C/C++ Source or Header  |  1998-08-28  |  2KB  |  82 lines

  1. /********************************************************************
  2.    
  3.     MenuWindow.h
  4.     
  5.     It is just the same like our Window.h we have used before, but
  6.     we need some more.
  7.     
  8.     So I include here our Window.h...
  9.  
  10. *********************************************************************/
  11.  
  12. #define PARENT
  13. #include "/includes/Window.h"
  14.  
  15. /********************************************************************/
  16.  
  17. // saving for later some typing work - making again a nice define :-)
  18.  
  19. #define GET_MENUID(a,b) ((USHORT)GTMENUITEM_USERDATA(ItemAddress(a->MenuStrip, b->Code))) 
  20.  
  21. enum                     // preparing some ID's 
  22. {
  23.     MENU_ID_PROJECT = 1,  // it must start higher than "0" !!
  24.     MENU_ID_SAVE,
  25.     MENU_ID_QUIT,
  26.     
  27.     MENU_ID_NEXT_MENU,
  28.     MENU_ID_ITEM
  29. };
  30.  
  31. // Now we must fill a MenuData structure
  32. // You may use for the flags also the standard Intuition or 
  33. // GadTools menu flags... (to get checkable menus, ...)
  34.  
  35. MenuData winmenu[] =
  36. {
  37.     {
  38.         NM_TITLE,                // it's a menu title
  39.         MENU_ID_PROJECT,         // ID
  40.         MSG_PROJECT,             // ID code of the string to display
  41.         0                        // no flags 
  42.     },
  43.     {
  44.         NM_ITEM,                 // it's a item
  45.         MENU_ID_SAVE,            // ID code of the item
  46.         MSG_SAVE,                // ID of the string
  47.         MENUFLAG_COMM_SEQ |      // use (allow) the usage of a key combination with R-Amiga
  48.         MENUFLAG_USE_SEQ  |      // but we want our own key 
  49.         MENUFLAG_MAKE_SEQ( 'W' ) // we want (here) the 'W' key (for example)
  50.     },
  51.     {
  52.         NM_ITEM,                 // item
  53.         0,                       // no ID - here is "0" allowed
  54.         NM_BAR_LABEL,            // a barlabel
  55.         0
  56.     },
  57.     {
  58.         NM_ITEM,
  59.         MENU_ID_QUIT,
  60.         MSG_QUIT,
  61.         MENUFLAG_COMM_SEQ        // here we take now the key we'll get
  62.     },                          // but here it should be "Q" ...
  63.     {
  64.         NM_TITLE,                // next menu title
  65.         MENU_ID_NEXT_MENU,
  66.         MSG_NEXT_MENU, 
  67.         0
  68.     },
  69.     {
  70.         NM_ITEM,                 // first entry of "Next Menu"
  71.         MENU_ID_ITEM,
  72.         MSG_ITEM,
  73.         0
  74.     },
  75.     {
  76.         NM_END                   // Don't forget this...
  77.     }
  78. };
  79.  
  80. // that's all... :-)  
  81.       
  82.